Repository navigation
fix(plugin-audit): an activity text names a referenced record by title only to a reader served that title field and admitted to its object - #34653
Conversation
…le is served only to a reader who may read that title Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
…itle Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 12 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4f64bed7ab3548218729c0e301e40cd6fae9bd08 && git checkout 4f64bed7ab3548218729c0e301e40cd6fae9bd08
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f02f4f63707bd05ae2186ca63babd54bfe37abcc f576d3d0629997ea29a25539eb30dc890ff78aeb && git checkout -B drift-repro f02f4f63707bd05ae2186ca63babd54bfe37abcc && git merge --no-ff f576d3d0629997ea29a25539eb30dc890ff78aeb
node scripts/docs-audit/affected-docs.mjs --json f02f4f63707bd05ae2186ca63babd54bfe37abcc
|
…ose API exposure serves get Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
…n the second-object exposure census Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
|
security#2 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj 席位核对ACCEPT · head
|
…its exposure to the write that read it Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj Co-authored-by: Claude <noreply@anthropic.com>
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44027970675 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
security#2 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj 席位核对ACCEPT · head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44066178950 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Clause-②: no
Metadata-protocol: none
维护者速读
get的目标取标题,其余按 id 写入,同一句可一处为标题、一处为 id。$expand的判法一致(referenceNameVisible只放开对象级拒绝,不放开字段级规则)。packages/plugins/plugin-audit/src/activity-field-redaction.ts(referenceTitlesPerRead与redactActivityRows文本列判定处);packages/plugins/plugin-audit/src/activity-field-redaction.test.ts(末尾两个新 describe);packages/core/src/security/second-object-read-exposure.pin.test.ts(新增的executes一行)。pnpm --filter @objectstack/plugin-audit exec vitest run src/activity-field-redaction.test.ts,预期 1 个文件、35 个用例全部通过(其中新增 16 个)。What changes
Hardening rule: an activity text that names a referenced record by its title is served only to a reader served that title field and admitted to its object.
An activity row names a referenced record by its title in three places: the record label of an object whose
nameFieldis a lookup oruserfield, a tracked reference field's change, and a fired milestone's reference token. Thesys_activityread redaction (activity-field-redaction.ts) now judges each such text against the object every such reference points at, by the two answers$expandjudges a target's title by at that level:resolveDisplayField) unmasked, by the same served-fields answer the redaction already uses, which also withholds a formula title computed from a field the reader may not read;canReadObject). A reference field that declaresreferenceNameVisiblelifts this object-level admission and never the field-level rule, as on$expand.Otherwise the text is left out of the row the way any activity text composed from a field the reader is not served already is, and the row keeps its
record_id. A reader served each referenced title field and admitted to each referenced object, and every system read, are served the row as before. The judgement is made at read time from the security service's answers, once per referenced object per read; no row is read for it, and stored rows are judged the same way.A target's declared API exposure (ADR-0049) stays decided where its title is read: the mirror titles a reference only when the target's exposure serves
get(servesSummaryTitleTarget), and names every other referenced record by its stored id, per id, so one sentence can title one reference and name another by its id. The read redaction judges its reader against every reference a sentence names by the two answers above, whatever the target's exposure. The second-object exposure census (packages/core/src/security/second-object-read-exposure.pin.test.ts) classifies the redaction as executing the readaudit-writers.tsdecides: it reads no record of the target and no title.The notification door was measured too: an approval notification already names its record by a title its recipient may read, else not at all (a formula title over a withheld field included). This PR adds a door-level pin for it and changes no notification code.
Tests
packages/plugins/plugin-audit/src/activity-field-redaction.test.ts, two new top-level describes in the shared harness:AuditPluginmirror, with a security double answering the field members andcanReadObjectper reader (8 cases): a reader not served the referenced title field, a reader refused the referenced object,referenceNameVisibleon each, a tracked reference change, one change naming a target whose exposure serves nogetby its id and an exposed target by its title (served to a reader who may read that title, to no reader withheld it), the by-id read, and the control reader;referenceTitlesPerReaddirectly (8 cases): non-reference sources, every declared reference judged, field and admission halves,referenceNameVisible, fail closed on a throwing admission or an unregistered target, a title-less target, a target whose exposure serves nogetjudged by the reader like any other, no admission member.packages/core/src/security/second-object-read-exposure.pin.test.ts:activity-field-redaction.tsclassified inCALLERSasexecutes, decided inpackages/plugins/plugin-audit/src/audit-writers.ts.bootStackwith the realSecurityPlugin):packages/qa/dogfood/test/activity-label-display-field.dogfood.test.ts, new top-level describe: a reader whose permission set withholds the referenced title field against the control, throughGET /data/sys_activitylist and by id, armed on the data plane first;packages/qa/dogfood/test/approval-notification-body.dogfood.test.ts, new top-level describe: two approvers of one request, one withheld a field of the record's formula title, read back from each approver'sGET /api/v1/notifications, armed on the data plane first.packages/qa/dogfood/test/lookup-title-exposure.dogfood.test.ts(unchanged) holds the exposure half: a summary names a target whose exposure serves nogetby its stored id and the exposed control by its title, for an administrator and a member.Acceptance notes
Updated X "label": Field) that names a changed reference field by its field label also declares that field as a source, so it is left out for a reader refused that reference's title, though the sentence carries no title of the referenced record. The fail-closed direction; noted, not changed.getby its id is left out for a reader refused that target's title field or object, though it carries only the id. The fail-closed direction; noted, not changed.no: no input is refused and no accepted set narrows; a reader is served a row without a text column it may not read, the shape every earlier change to this redaction declared.Verification
All readings at head
e2133d6830(branchclaude/sec2-ph96, merged withorigin/main), each run underscripts/pm/os-verify-lock.sh.plugin-audit, core's repo project and the second-object exposure pin
Dogfood: the whole battery, then the touched files and the battery's timed-out files
All five failures are
Error: Test timed out in 5000ms., in four files outside this diff (bare-name-one-holder-request-family,external-import-walled-catalog-refusal,flow-provenance-server-held,package-commit-revert-path-package), on a shared box under load (the battery held the lock 4035 s). The same four files were run again with the three files this change bears on (lookup-title-exposure,activity-label-display-field,approval-notification-body):Ablations (earlier rounds; the judged path is unchanged since)
redactActivityRowsreplaced withtrue:src/activity-field-redaction.test.ts5 failed (the engine-level reader cases), then restored, blob == HEAD,git diff HEADempty.Gates: derived families, reconciled
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat this head: 73 commands, each run, exit code captured before any pipe;--ranreconciliation:NOT MEASURED locally, prerequisite not met:
check:dual-build-cjs-loads,check:type-check-debt; both run in CI. The derivation does not list core'srepoproject pin for this diff; it was run explicitly above.Generated by Claude Code